package com.example.soss.util;

import com.example.soss.entity.Student;
import org.springframework.stereotype.Component;

@Component
public class UserContextHolder {
    private static ThreadLocal<Student> map = new ThreadLocal<>();

    public static void setUser(Student student) {
        map.set(student);
    }

    public static Student getUser() {
        return map.get();
    }

    public static void clear() {
        map.remove();
    }
}
